package designPattern.factoryMethod.normal;

import designPattern.factoryMethod.MailSender;
import designPattern.factoryMethod.Sender;
import designPattern.factoryMethod.SmsSender;
import org.apache.commons.lang3.StringUtils;

/**
 * Created by cdxuhongya on 2017/1/6.
 */
public class SendFactory {
    public Sender product(String type){
        if(StringUtils.equals(type,"sms")){
            return new SmsSender();
        }else if(StringUtils.equals(type,"mail")){
            return new MailSender();
        }else{
            return null;
        }
    }
}
